<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<sj:head />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>EVON Global Logistics Solution</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/functionality.js"></script>
</head>

<body onload="hideall()">
<sj:div id="keyBinDiv" name="keyBinDiv" cssClass="maincontent"
	indicator="indicator">
	<s:form action="addKeyBinAction" id="KeyBinForm" theme="simple" validate="true">
		<!--<div id="maincontent">

		<div class="clear"></div>
		<div class="headingbg">Manage Key Bin</div>
		<div class="clear"></div>

		<h4><s:actionmessage /></h4>
		<div class="contentarea">
		-->
			<h4>
<s:actionmessage/>
<s:fielderror></s:fielderror>

</h4>
		
		<table width="99%" border="0" align="center" cellpadding="4"
			cellspacing="1" class="gridtable">
			<tr>
				<th colspan="4">Edit Details</th>
			</tr>

			<tr class="alt">
				<td>Key Bin Name</td>
				<td><s:textfield name="keyBinDTO.keyBinName"
					value="%{keyBinDTO.keyBinName}" /></td>
				<td>Key Bin Number</td>
				<td><s:textfield name="keyBinDTO.keyBinNumber"
					value="%{keyBinDTO.keyBinNumber}" /></td>
			</tr>
			<tr class="alt">
				<td>Active</td>
				<td><s:checkbox name="keyBinDTO.active"
					value="%{keyBinDTO.active}"></s:checkbox></td>
				<td>Occupied</td>
				<td><s:checkbox name="keyBinDTO.keyOccupied"
					value="%{keyBinDTO.keyOccupied}"></s:checkbox></td>
				
			</tr>
			<tr class="alt">
			<td>Slot#</td>
				<td><s:textfield name="keyBinDTO.capacity"
					value="%{keyBinDTO.capacity}" /></td>
			</tr>
		</table>
		<table width="99%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td style="height: 10px;"></td>
			</tr>
			<tr>
				<td align="right">
					<s:url var="submitKeyBinUrl" action="addKeyBinAction" >
					<s:param name="yardId" value="%{yardId}"/></s:url>
				<sj:submit href="%{submitKeyBinUrl}"  targets="keyBinDiv" formIds="KeyBinForm" cssClass="btnbg" />
				
				</td>
				
				<td align="right">
					<s:url var="addKeyBoxUrl" action="addKeyBox" ></s:url>
				<sj:submit href="%{addKeyBoxUrl}"  targets="keyBinDiv" formIds="KeyBinForm" cssClass="btnbg" value="Add Key Box" />
				
				</td>
			</tr>
		</table>
		<!--</div>
		</div>
	-->



	<table border="1" width="100%">
		<tr bgcolor="#038040">
			<td>KeyBoxNumber</td>
			<td>KeyBoxName</td>
			<td>keyBoxOccupied</td>
			<td>keyBoxActive</td>
		</tr>
		<s:hidden id="keyBinDTO.keyBinId" name="keyBinDTO.keyBinId"
			value="%{keyBinDTO.keyBinId}"></s:hidden>
		<s:iterator value="listKeyBoxes" status="status" status="pSlot">
			<tr>
				<!--<td>
  
  <s:textfield  name="keyBoxId"  value="" ></s:textfield>
  </td>
  -->
  <s:hidden   name = "listKeyBoxes[%{#pSlot.index}].keyBoxId"  value ="%{keyBoxId}"></s:hidden>
				<td><s:textfield
					name="listKeyBoxes[%{#pSlot.index}].keyBoxNumber"
					value="%{keyBoxNumber}"></s:textfield></td>
				<td><s:textfield
					name="listKeyBoxes[%{#pSlot.index}].keyBoxName"
					value="%{keyBoxName}"></s:textfield></td>
				<td><s:checkbox
					name="listKeyBoxes[%{#pSlot.index}].keyBoxOccupied"
					value="%{keyBoxOccupied}"></s:checkbox></td>
				<td><s:checkbox
					name="listKeyBoxes[%{#pSlot.index}].keyBoxActive"
					value="%{keyBoxActive}"></s:checkbox></td>
			</tr>

		</s:iterator>



	</table>
	
	<s:url var="submitKeyBoxUrl" action="addKeyBoxesAction" >
					<s:param name="yardId" value="%{yardId}"/></s:url>
				<sj:submit href="%{submitKeyBoxUrl}"  targets="keyBinDiv" formIds="KeyBinForm" cssClass="btnbg" />
				
				<td align="right">
					<s:url var="backUrl" action="manageAllKeyBins" >
					<s:param name="selectedYardId" value="%{yardId}"/>
					<s:param name="oemType" value="%{oemId}"/></s:url>
				<sj:submit href="%{backUrl}"  targets="keyBinDiv" formIds="KeyBinForm" cssClass="btnbg" value="Back"/>
				
				</td>
</s:form>
</sj:div>
<br />
<br />

</body>
</html>
